package com.sgs.preorder.domain.client;

import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @author Tim_Tian
 * @date 2021/7/17 16:23
 */
@Component
public class ReportClientFallBackFactory implements FallbackFactory<ReportClient> {

    private static Logger logger = LoggerFactory.getLogger(ReportClientFallBackFactory.class);

    @Override
    public ReportClient create(Throwable throwable) {
        return new ReportClient() {

            @Override
            public ReportSimplifyDTO getReportSimplify(String reportNo) {
                logger.warn("调用Report错误，这里fallback");
                return null;
            }
        };
    }
}
